<?php
class LRTransfer
{
	var $payerAcct;
	var $payeeAcct;
	var $transferId;
	var $amount;
	var $currency;
	var $memo = "";
	var $isPrivate = false;

	function LRTransfer($payeeAcct, $amount, $transferId = '', $memo = '', $currency = "LRUSD", $isPrivate = false)
	{
		$this->payeeAcct = $payeeAcct;
		$this->transferId = $transferId;
		$this->amount = $amount;
		$this->currency = $currency;
		$this->memo = $memo;
		$this->isPrivate = $isPrivate;
	}

	function toXml()
	{
		$xml = '<Transfer>';

		if ($this->transferId != '') $xml .= '<TransferId>' . $this->transferId . '</TransferId>';

		$xml .= '<TransferType>transfer</TransferType>' .
				'<Payer>' . $this->payerAcct . '</Payer>' .
				'<Payee>' . $this->payeeAcct . '</Payee>' .
				'<CurrencyId>' . $this->currency . '</CurrencyId>' .
				'<Amount>' . $this->amount . '</Amount>';

		if ($this->memo != '') $xml .= '<Memo>' . $this->memo . '</Memo>';

		$xml .= '<Anonymous>' . ($this->isPrivate ? 'true' : 'false') . '</Anonymous></Transfer>';

		return $xml;
	}
}